﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://vipper.peshiba.cz/schemas/DbmlUpdater/v2" xmlns="http://vipper.peshiba.cz/schemas/DbmlUpdater/v2" xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:simpleType name="modeEnum">
		<xs:restriction base="xs:string">
			<xs:enumeration value="None"/>
			<xs:enumeration value="AllExceptListed"/>
			<xs:enumeration value="OnlyListed"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:element name="DbmlUpdater">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="DBML" minOccurs="1" maxOccurs="1">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Tables" minOccurs="0" maxOccurs="1">
								<xs:complexType>
									<xs:sequence>
										<xs:element minOccurs="0" maxOccurs="unbounded" name="Table" type="xs:string" />
									</xs:sequence>
									<xs:attribute name="mode" type="modeEnum" use="optional" default="AllExceptListed" />
								</xs:complexType>
							</xs:element>
							<xs:element name="Views" minOccurs="0" maxOccurs="1">
								<xs:complexType>
									<xs:sequence>
										<xs:element minOccurs="0" maxOccurs="unbounded" name="View" type="xs:string" />
									</xs:sequence>
									<xs:attribute name="mode" type="modeEnum" use="optional" default="None" />
								</xs:complexType>
							</xs:element>
							<xs:element name="Functions" minOccurs="0" maxOccurs="1">
								<xs:complexType>
									<xs:sequence>
										<xs:element minOccurs="0" maxOccurs="unbounded" name="Function" type="xs:string" />
									</xs:sequence>
									<xs:attribute name="mode" type="modeEnum" use="optional" default="None" />
								</xs:complexType>
							</xs:element>
							<xs:element name="SProcs" minOccurs="0" maxOccurs="1">
								<xs:complexType>
									<xs:sequence>
										<xs:element minOccurs="0" maxOccurs="unbounded" name="SProc" type="xs:string" />
									</xs:sequence>
									<xs:attribute name="mode" type="modeEnum" use="optional" default="None" />
								</xs:complexType>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="connectionString" type="xs:string" use="required" />
						<xs:attribute name="generate" type="xs:boolean" use="optional" default="true" />
						<xs:attribute name="deleteOnComplete" type="xs:boolean" use="optional" default="true" />
					</xs:complexType>
				</xs:element>
				<xs:element name="Code" minOccurs="1" maxOccurs="1">
					<xs:complexType>
						<xs:attribute name="generate" type="xs:boolean" use="optional" default="true" />
						<xs:attribute name="namespace" type="xs:string" use="required" />
						<xs:attribute name="context" type="xs:string" use="required" />
						<xs:attribute name="lang" use="optional">
							<xs:simpleType>
								<xs:restriction base="xs:string">
									<xs:enumeration value="cs" />
									<xs:enumeration value="vb" />
								</xs:restriction>
							</xs:simpleType>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>